namespace NICWebApi.Extensions.JWT.Options;

/// <summary>
/// Jwt 配置
/// </summary>
public sealed class JWTSettingsOptions
{
    /// <summary>
    /// 验证签发方密钥
    /// </summary>
    public bool? ValidateIssuerSigningKey { get; set; } = true;

    /// <summary>
    /// 签发方密钥
    /// </summary>
    public string? IssuerSigningKey { get; set; } = "U2FsdGVkX1+6H3D8Q//yQMhInzTdRZI9DbUGetbyaag=";

    /// <summary>
    /// 验证签发方
    /// </summary>
    public bool? ValidateIssuer { get; set; } = true;

    /// <summary>
    /// 签发方
    /// </summary>
    public string? ValidIssuer { get; set; } = "dotnetchina";

    /// <summary>
    /// 验证签收方
    /// </summary>
    public bool? ValidateAudience { get; set; } = true;

    /// <summary>
    /// 签收方
    /// </summary>
    public string? ValidAudience { get; set; } = "powerby Furion";

    /// <summary>
    /// 验证生存期
    /// </summary>
    public bool? ValidateLifetime { get; set; } = true;

    /// <summary>
    /// 过期时间容错值，解决服务器端时间不同步问题（秒）
    /// </summary>
    public long? ClockSkew { get; set; } = 10;

    /// <summary>
    /// 过期时间（分钟）
    /// </summary>
    public long? ExpiredTime { get; set; } = 20;

    /// <summary>
    /// 加密算法
    /// </summary>
    public string? Algorithm { get; set; } = "SecurityAlgorithms.HmacSha256";

    /// <summary>
    /// 验证过期时间，设置 false 永不过期
    /// </summary>
    public bool RequireExpirationTime { get; set; } = true;
}